﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp.装饰器
{
    /// <summary>
    /// 4.1 添加快递费 - 具体装饰器
    /// </summary>
    public class ShippingDecorator : OrderDecorator
    {
        private readonly double _shippingCost;

        public ShippingDecorator(IOrder order, double shippingCost) : base(order)
        {
            _shippingCost = shippingCost;
        }

        public override double CalculateTotal()
        {
            return base.CalculateTotal() + _shippingCost;
        }
    }
}
